Skip to content

fix: increase Test_Server_CapabilityError timeout to prevent flaky race (CRE-4319)#22496

Closed
Tofel wants to merge 3 commits into
developfrom
fix/flaky-CRE-4319-2026-05-15
Closed

fix: increase Test_Server_CapabilityError timeout to prevent flaky race (CRE-4319)#22496
Tofel wants to merge 3 commits into
developfrom
fix/flaky-CRE-4319-2026-05-15

Conversation

@Tofel
Copy link
Copy Markdown
Contributor

@Tofel Tofel commented May 15, 2026

Summary

  • Increases RequestTimeout from 100ms to 10s in Test_Server_CapabilityError to eliminate a race condition between the server's expiry ticker and async message delivery.

Root cause

RequestTimeout=100ms equalled the ticker interval returned by getServerTickerInterval. On loaded CI machines, the expiry goroutine fires Cancel(Error_TIMEOUT) before all 10 async messages from 10 workflow peers complete delivery through testAsyncMessageBroker's serial sendCh consumer. The 10th OnMessage then finds hasResponse()==true (set by Cancel) and dispatches Error_TIMEOUT instead of the expected Error_INTERNAL_ERROR.

Fix

Raise the timeout to 10s — matching the convention used by other tests in this file. TestErrorCapability returns synchronously, so the test still completes in milliseconds; only the safety margin changes.

Flaky test fixes

Issue Test Trunk
CRE-4319 Test_Server_CapabilityError Trunk test case

Test plan

  • Test_Server_CapabilityError passed 10/10 runs locally with -race -shuffle=on
  • golangci-lint clean for ./core/capabilities/remote/executable/...
  • CI green

Tofel added 3 commits May 15, 2026 16:40
…h expiry ticker

RequestTimeout was 100ms — equal to the ticker interval — causing the expiry
goroutine to fire Cancel(Error_TIMEOUT) before async broker delivery of all 10
messages completed on loaded CI machines.

Fixes CRE-4319
Copilot AI review requested due to automatic review settings May 15, 2026 15:25
@Tofel Tofel requested review from a team as code owners May 15, 2026 15:25
@github-actions
Copy link
Copy Markdown
Contributor

👋 Tofel, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
/core/capabilities/ 1 @smartcontractkit/keystone, @smartcontractkit/capabilities-team
/tools/test/ 21 @smartcontractkit/devex-cicd, @smartcontractkit/devex-tooling, @smartcontractkit/core

Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown

For more details, see the full review summary.

@github-actions
Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.

Comment thread core/capabilities/remote/executable/server_test.go
Comment thread tools/test/.agents/skills/_shared-jira-flaky-ops/abandon-ticket.md
@cl-sonarqube-production
Copy link
Copy Markdown

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 15, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@Tofel
Copy link
Copy Markdown
Contributor Author

Tofel commented May 15, 2026

Superseded by #22501

@Tofel Tofel closed this May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants